package com.xzm.test;

import com.xzm.dao.IUserDao;
import com.xzm.service.IUserService;
import com.xzm.service.impl.UserServiceImpl;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * @author 3052
 * @create 2020-07-26 21:12
 */
public class main {

    public static void main(String[] args) {

//        BeanFactory ac = new ClassPathXmlApplicationContext("bean.xml");
        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
        IUserService userService = (IUserService)ac.getBean("userServiceImpl");
        //IUserService userService2 = (IUserService)ac.getBean("userServiceImpl");
//        System.out.println(userService);
        userService.saveUser();
/*        IUserDao userDao = ac.getBean("userDao",IUserDao.class);
        System.out.println(userDao);*/
//        System.out.println(userService==userService2);
        ac.close();
    }
}
